﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DKPScoreWebApi.Models
{
    /// <summary>
    /// 成员进度实体类
    /// 记录成员在进度类型项目上的当前进度
    /// </summary>
    public class MemberProgress
    {
        /// <summary>
        /// 进度ID，主键，自增
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 成员ID，外键关联GuildMember
        /// </summary>
        [Required]
        public int MemberId { get; set; }

        /// <summary>
        /// 积分项目ID，外键关联PointItem
        /// </summary>
        [Required]
        public int ItemId { get; set; }

        /// <summary>
        /// 当前进度值
        /// </summary>
        public int CurrentProgress { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime LastUpdated { get; set; } = DateTime.Now;

        // 导航属性
        /// <summary>
        /// 相关成员信息
        /// </summary>
        [ForeignKey("MemberId")]
        public virtual GuildMember Member { get; set; }

        /// <summary>
        /// 相关积分项目信息
        /// </summary>
        [ForeignKey("ItemId")]
        public virtual PointItem PointItem { get; set; }
    }
}
